package com.yuyue.springFramework.note09.module2;

import com.yuyue.springFramework.note09.module1.Service2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Service3 {
    //自动填充Service1
    @Autowired
    Service1 service1;

    //自动填充Service2
    @Autowired
    Service2 service2;

    //调用service1方法
    public void method1(){
        service1.method1();
    }

    //间接调用service1方法
    public void method2(){
        service2.method1();
    }
}
